﻿/******************************************************************
 *Company: http://www.xiaomutech.com/
 *fileName : logindialog.cpp --- LoginDialog
 *Auth       : yhni (QQ:393320854)
 *Create    : 2022/1/17
 *Description   :
 *Histroy:
 *<Auth>    <Date>        <Ver>        <Content>
 *         2022/1/17
 *******************************************************************/
#include "logindialog.h"
#include "ui_logindialog.h"
#include <QDebug>

LoginDialog::LoginDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::LoginDialog)
{
    ui->setupUi(this);
    Qt::WindowFlags flags = this->windowFlags();
    flags &= ~Qt::WindowContextHelpButtonHint;
    this->setWindowFlags(flags);
}

LoginDialog::~LoginDialog()
{
    delete ui;
}

int LoginDialog::getUserId()
{
    return ui->lineEditUser->text().toInt();
}

int LoginDialog::getDesktopSeq()
{
    return ui->lineEditSeq->text().toInt();
}

void LoginDialog::on_btnLogin_clicked()
{
    // check user
    QString strPass = ui->lineEditPasswd->text();
    if (!QString::compare("123456", strPass)) {
        this->done(1);
    }
}

void LoginDialog::on_btnCancel_clicked()
{
    this->done(0);
}
